/*
 * @Author: Li Zengkun
 * @Date: 2022-09-13 14:07:36
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-09-13 15:04:16
 * @Description: 
 */
import { admin } from '@/api'

export default ({
    namespaced: true,
    state: () => {
        return {
            profile: null,
        }
    },
    getters: {},
    mutations: {
        SetProfile(state, data) {
            state.profile = data
        }
    },
    actions: {
        async loadProfile({ commit, state }, id) {
            let { status, data } = await admin.info({ id })
            if (status) {
                commit('SetProfile', data)
            }

        }
    },
    modules: {}
})